﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ElectronicsMarket.Service.IService;
using ElectronicsMarket.Service.Models;
namespace ElectronicsMarket.Service.ServiceImpl
{
    public class CustomerImpl:ICustomer
    {
        private ElectronicsMarketDBClassesDataContext eMEntity;
        public CustomerImpl()
        {
            eMEntity = new ElectronicsMarketDBClassesDataContext();
        }
         public CUSTOMER getCustomerByID(int id)
        {
            CUSTOMER cus = eMEntity.CUSTOMERs.Single(c => c.CUSTOMER_ID == id);
            return cus;
        }
        
         public  List<CUSTOMER> getAllCustomer()
        {
            List < CUSTOMER > cus = eMEntity.CUSTOMERs.ToList();
            return cus;
        }
    }
}